package com.springboot.manager.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @version v1.0
 * @ClassName: CommonResult
 * @Description: 通用返回结果
 * @Author: zhangzl
 * @Date: 2021-04-08 8:41
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class CommonResult<T> implements Serializable {

    /**
     * 【描述】：响应编码
     */
    private Integer code;

    /**
     * 【描述】：异常描述
     */
    private String message;

    /**
     * 【描述】：响应结果
     */
    private T data;

    public CommonResult(Integer code) {
        this.code = code;
    }

    public CommonResult(Integer code, T data) {
        this.code = code;
        this.data = data;
    }
}
